/*
 * @Date         : 2024-05-20 11:18:26 星期1
 * @Author       : xut
 * @Description  :
 */
import { Router } from "express"
import { zodSchemaValidate as validate } from "../middleware/zodSchemaValidate.middleware"
import * as post from "../controller/post.controller"
import {
  getPostPageSchema,
  getPostSchema,
  createPostSchema,
  updatePostSchema,
  deletePostSchema,
} from "../schema/post.schema"

export const router = Router()

router.get("/page", validate(getPostPageSchema), post.getPostPage)
router.get("/:postId", validate(getPostSchema), post.getPost)
router.post("/", validate(createPostSchema), post.createPost)
router.patch("/:postId", validate(updatePostSchema), post.updatePost)
router.delete("/:postId", validate(deletePostSchema), post.deletePost)
